"""
pattern：正则模式，一个正则字符串
"""
import re
# 包
# print(re)

# r = re.search(r'1','123456')
# print(r,type(r))
# print(r.group(),r.span(),r.start(),r.end())


# search 可以返回一个Match对象 最多只匹配一个  无则返回None
# r = re.search(r'abc','123abc123abc')
# print(r,type(r))
# print(r.group(),r.span(),r.start(),r.end())
# r = re.search(r'[a-z]+','123abc123abc')
# print(r,type(r))
# print(r.group(),r.span(),r.start(),r.end())
#
#
# # 可以返回一个列表  列表中存放字符串  无 则返回一个空列表
# r = re.findall(r'[a-z]+','123abc123abc')
# print(r,type(r))
# r = re.findall(r'[0-9]+','123abc123abc')
# print(r,type(r))

# r = re.split(r'1\w*3','yf123sb3456sb1sb4')
# print(r,type(r))

c = re.compile(r'a\wc')
# print(c,type(c))
# r = c.search('123abc123adc123acc')
# print(r,type(r))
# print(r.group())
#
# r = c.findall('123abc123adc123acc')
# print(r,type(r))
#
# r = c.finditer('123abc123adc123acc')
# print(r,type(r))
# for i in r:
#     print(i)
#     print(i.group())
#
# r = c.sub('***','123abc123adc123acc')
# print(r)
#
# r = re.sub(r'a\wc','***','123abc123adc123acc')
# print(r,type(r))


# r = re.findall(r'^a.c','abc\nadc\nacc',re.M)
# print(r)
# r = re.findall(r'^a\wc','abc\nadc\nacc',re.M)
# print(r)
# r = re.findall(r'.*?','abcadcacc')
# print(r)
# r = re.findall(r'\d\w\s\D\W\S','1_\ta-1')
# print(r)
# r = re.findall(r'a[0-9a-z_A-Z]c','abcadca1ca2ca_caAc')
# print(r)


r = re.findall(r'[\u4e00-\u9fa5]+','521大猪蹄子1314真香')
print(r)